﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;
using MyHelpers.BaseExtender;

namespace MyHelpers
{
    public class Submit : ExtenderBase
    {

        public Submit(object htmlAttributes)
            : base(htmlAttributes)
        {
        }

        private string RenderSubmit()
        {
            var wrapper = new TagBuilder("input");
            wrapper.Attributes.Add("type", "submit");
         
            wrapper.MergeAttributes(htmlAttributes != null ? HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes) : null);
            if (!wrapper.Attributes.ContainsKey("value"))
            {
                wrapper.Attributes.Add("value", "Wyślij");
            }
            //if (alertStyle != AlertStyle.Default)
            //    wrapper.AddCssClass(alertStyle.ToString().ToLower());
            //wrapper.AddCssClass("alert-box");


            ////build html
            //wrapper.InnerHtml = text;

            ////Add close button
            //if (!hideCloseButton)
            //    wrapper.InnerHtml += RenderCloseButton();

            //return wrapper.ToString();

            return wrapper.ToString();
        }

        public override string ToHtmlString()
        {
            return RenderSubmit();
        }
    }
}
